package com.horizon.wxapp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.horizon.wxapp.dao.UsersMapper;
import com.horizon.wxapp.entity.Users;
import com.horizon.wxapp.service.UsersService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UsersServiceImpl implements UsersService {

    @Resource
    private UsersMapper usersMapper;


    @Override
    public Users getUser(String nickName, String tel) {
        return usersMapper.selectOne(new LambdaQueryWrapper<Users>().eq(Users::getNickName, nickName)
                                                                    .eq(Users::getTel, tel));
    }

    @Override
    public void addUser(Users user) {
        usersMapper.insert(user);
    }
}
